package com.ztgf.commodity.models.service;

import com.baomidou.mybatisplus.service.IService;
import com.ztgf.commodity.models.bo.CommoditySpecificationRelationSaveBO;
import com.ztgf.commodity.models.dto.CommoditySpecificationRelationDTO;
import com.ztgf.commodity.models.vo.CommodityAttrPriceVO;

import java.util.List;

/**
 * 商品规格关系表服务
 * <p>
 * author chenyu.wang
 * Date 2020-05-27 10:59:08
 */
public interface ICommoditySpecificationRelationService extends IService<CommoditySpecificationRelationDTO> {

    /**
     * description: 添加
     * param: [saveBO]
     * author: chenyu.wang
     * date: 2020-05-27
     * return: boolean
     */
    boolean add(CommoditySpecificationRelationSaveBO saveBO);

    /**
     * description: 根据商品ID查询商品规格
     * param: [id]
     * author: chenyu.wang
     * date: 2020-05-28
     * return: java.util.List<com.ztgf.commodity.models.dto.CommoditySpecificationRelationDTO>
     */
    List<CommoditySpecificationRelationDTO> getByCommodityId(Long id);

    /**
     * description: 根据商品ID删除
     * param: [id]
     * author: chenyu.wang
     * date: 2020-05-29
     * return: boolean
     */
    boolean deleteBatchByGoodsId(Long id);

    /**
     * description: 根据商品id和属性ids查询具体一个商品信息
     * param: [goodsId, attrIds] 商品id，属性ids
     * author: chenyu.wang
     * date: 2020-06-08
     * return: com.ztgf.commodity.models.vo.CommodityAttrPriceVO
     */
    CommodityAttrPriceVO getGoodsSkuPrice(Long goodsId, String attrIds);

    /**
     * description: 添加商品库存
     * param: [id, num]
     * author: chenyu.wang
     * date: 2020-06-10
     * return: boolean
     */
    boolean updateInventory(Long id, Integer num);

    CommoditySpecificationRelationDTO selectByCommodityAndAttrIds(Long goodsId, String atrrIds);

    boolean batchUpdateInventory(String ids, Integer num);


}
